home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Bombardier_PC
/
BSCRIPTS.CST
/
00093_Script_knob
< prev
next >
Wrap
Text File
|
1999-04-25
|
5KB
|
160 lines
-- ⌐ 1998 @radical.media, inc. & Concurrent New Media Group, L.L.C.
-- Developed for Bombardier, Inc.
--
-- All programming developed by:
-- Robert Fabricant, Valerie Valoueva, Ossi Shaked,
-- Henry Sauvageot, Chris Howell & Chris Girand
--
-- Use of this code by parties other than @radical.media, inc. or their
--agents
-- without the express written consent of @radical.media, inc. AND Concurrent
-- New Media Group, L.L.C. is strictly prohibited.
------------------------------------------------------
property mySprite, myName, myHilite, myBoundary, myLoc, myBoundLoc, selected, myType, lastSelected, myGroup
global lastSub
on new me
global menuController
set mySprite = the spriteNum of me
set myLoc = the loc of sprite mySprite
set myName = the name of member the member of sprite mySprite
set myHilite = myName&"-close"
set selected = 0
puppetSprite mySprite, true
set the loc of sprite mySprite = point(-1000, -1000)
set scriptNum = the scriptNum of sprite mySprite
set myType = the name of member scriptNum
register menuController, me, myName
set coverSprite = getSpriteNumFromMemberName ("anchor")
return me
end
on heresYourGroup me, theGroup
set myGroup = theGroup
end
on setLastSelected me, theLastSelObj
set lastSelected = theLastSelObj
end
on getType me
return myType
end
--Set up a subcategory menu's background sprite
on setSprite me, theSprite
set myBoundary = theSprite
set myBoundLoc = the loc of sprite myBoundary
puppetSprite myBoundary, true
set the loc of sprite myBoundary = point(-1000, -1000)
end
on deselect me
repeat with i = 1 to count(myGroup)
set teamMate = getat(myGroup, i)
disable teamMate
end repeat
end
on disable me
set selected = 0
set the member of sprite mySprite = member myName
set faraway = point(-1000,-1000)
set the loc of sprite myBoundary = faraway
set the loc of sprite mySprite = faraway
end
--Clear previously selected subcategory
on deleteSub me
set lastSub = void
end
on mouseUp me
-- IWasSelected lastSelected, me
if selected then--clicked to fold up the subcategory menu
set selected = 0
set the loc of sprite myBoundary = point(-1000,-1000)
set the member of sprite mySprite = member myName
repeat with i = 1 to count(myGroup)
set teamMate = getat(myGroup, i)
set hisType = getType(teamMate)
-- Make sure that when a subcategory menu is closed clickin on
-- the category just reopens it,instead of taking
-- you to category section
if hisType = "category" then
setCatEnable teamMate, FALSE
end if
hideYourSelf teamMate
end repeat
else --clicked to open up the subcategory menu
set selected = 1
set the member of sprite mySprite = member myHilite
set the loc of sprite myBoundary = myBoundLoc
repeat with i = 1 to count(myGroup)
set teamMate = getat(myGroup, i)
set hisType = getType(teamMate)
-- Make sure that when a subcategory menu is open clickin on
-- the category will take you to category section
if hisType = "category" then
setCatEnable teamMate, TRUE
end if
showYourSelf teamMate
end repeat
end if
if not voidP(lastSub) then
reset lastSub --hilite currently selected subcategory
end if
puppetsound 3, "mouse5"
end
-- hide and show yourselves are called by the knob script itself to make its folks (category and subs) either be visible or not visible.
on hideYourSelf me
set faraway = point(-1000,-1000)
set the loc of sprite myBoundary = faraway
set the member of sprite mySprite = member myName
set the loc of sprite mySprite = myLoc
set selected = 0
end
on showYourSelf me
set selected = 1
set the loc of sprite myBoundary = myBoundLoc
set the loc of sprite mySprite = myLoc
set the member of sprite mySprite = member myHilite
end
-- the 2 rollover handlers
on mouseEnter me
if not selected then
set the member of sprite mySprite = member myHilite
end if
end
on mouseLeave me
if not selected then
set the member of sprite mySprite = member myName
end if
end
on setSubCat me, theSub
set lastSub = theSub
end
-- not called so far in this application but necessary to call if the "behaviour lines" for the submenus are ever broken.
on endPuppeting me
puppetSprite mySprite, false
puppetSprite myBoundary, false
end